from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Integer, Float
import sys

sys.path.append('D:/python-study/python-study/Homework/homework10/10.5/config')

from config.config import Config
Base = declarative_base()


class Student(Base):
    __tablename__ = 'student'
    Sno = Column(String(20), primary_key=True)
    Sname = Column(String(20))
    Ssex = Column(String(20))
    Sage = Column(Integer)
    Dno = Column(String(20))
    Sclass = Column(String(20))
    address = Column(String(255))


class Course(Base):
    __tablename__ = 'course'
    Cno = Column(String(20), primary_key=True)
    Cname = Column(String(20))
    Chours = Column(String(20))
    Credit = Column(Float)
    Tno = Column(String(15))
    StudentCount = Column(Integer)


class Teacher(Base):
    __tablename__ = 'teacher'
    Tno = Column(String(15), primary_key=True)
    Tname = Column(String(20))
    Dno = Column(String(2))
    Salary = Column(String(20))
    Tmobile = Column(String(15))


class Department(Base):
    __tablename__ = 'department'
    id = Column(Integer, primary_key=True, autoincrement=True)
    pid = Column(Integer)
    name = Column(String(100))


class Class(Base):
    __tablename__ = 'class'
    ClassID = Column(String(20), primary_key=True)
    ClassName = Column(String(20))


class Dept(Base):
    __tablename__ = 'dept'
    Dno = Column(String(2), primary_key=True)
    Dname = Column(String(20))
    Dean = Column(String(20))


class SC(Base):
    __tablename__ = 'sc'
    Sno = Column(String(20), primary_key=True)
    Cno = Column(String(20), primary_key=True)
    Score = Column(Integer)